home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
001-010
/
amok08
/
iff8svxload
/
playkanon.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
2KB
|
74 lines
(*---------------------------------------------------------------------------
:Program. PlayKanon.mod
:Author. Fridtjof Siebert
:Address. Nobileweg 67, D-7-Stgt-40
:Shortcut. [fbs]
:Version. 1.0
:Date. 19-Sep-88
:Copyright. PD
:Language. Modula-II
:Translator. M2Amiga
:Imports. IFF8SVXLoad [fbs], MemSystem [bne]
:UpDate. none.
:Contents. Program to play a sampled Sound on 4 times with 0.5s delay.
:Remark. Usage: PlayKanon <iff-soundfile>
---------------------------------------------------------------------------*)
MODULE PlayKanon;
FROM SYSTEM IMPORT ADR, ADDRESS, SHIFT, BITSET, LONGSET, CAST;
FROM Arts IMPORT Terminate;
FROM Arguments IMPORT NumArgs, GetArg;
FROM Dos IMPORT Delay;
FROM IFF8SVXLoad IMPORT Read8SVX, Dealloc8SVX, IFF8SVXInfoPtr, PlaySample,
OpenAudio, CloseAudio, WaitPlay, AllChannels;
CONST
ProgName = "PlaySample, © 1988 by Fridtjof Siebert [Amok]";
VAR
Name: ARRAY[0..79] OF CHAR; (* the Sound's Name *)
length: INTEGER; (* dummy for receiving Name's Length *)
Info: IFF8SVXInfoPtr; (* Sound's Data *)
i: CARDINAL;
BEGIN
(*------ Get Name: ------*)
IF NumArgs()#0 THEN
GetArg(1,Name,length);
ELSE
Terminate(0);
END;
(*------ Read and Play Sound: ------*)
Info := Read8SVX(Name,20000,FALSE); (* load sound *)
IF Info#NIL THEN
IF OpenAudio(4,0) THEN (* open audio *)
FOR i:=0 TO 3 DO
IF PlaySample(Info,0,1,i) THEN (* play sound *)
Delay(25);
END;
END;
WaitPlay(AllChannels);
Delay(100); (* wait 2s to get last samples before closing audio *)
CloseAudio(); (* close audio *)
END;
Dealloc8SVX(Info); (* free sound *)
END;
END PlayKanon.